const { drawImg } = require('./webgl_first_render.js');

function render() {
  if (FIRSTRENDER) {
    drawImg('first.jpg', gl);
    requestAnimationFrame(render);
  }
}

tt.setPreferredFramesPerSecond(60);
var FIRSTRENDER = true;
GameGlobal.dycc = tt.createCanvas();
GameGlobal.screencanvas = GameGlobal.dycc || new _Canvas2.default()
const { screenWidth, screenHeight } = tt.getSystemInfoSync();
GameGlobal.dycc.width = screenWidth;
GameGlobal.dycc.height = screenHeight;
var gl = GameGlobal.dycc.getContext("webgl", { stencil: true });//不加{stencil:true}开发者工具上会出现白屏

requestAnimationFrame(render);

// 加载引擎代码写在这后面
const loader = require("./engine-loader");
loader.loadEngine("engine", () => { FIRSTRENDER = false; });//此处设置FIRSTRENDER 为false是为了防止子包加载完成后一直在渲染导致黑屏